package com.gainloop.Api;

import org.json.JSONException;
import org.json.JSONObject;

import com.gainloop.Api.Entity.EntityAbstract;

public class ApiResponseObject<T extends EntityAbstract> extends ApiResponseAbstract<T, T>
{

	public ApiResponseObject(JSONObject response, Class<T> classT) throws JSONException {
		super(response, classT);
	}

	public ApiResponseObject(int retCode, T data, String error, Class<T> classT) {
		super(retCode, data, error, classT);
	}

	@Override
	protected T _getData(JSONObject response) throws JSONException {
		return EntityAbstract.fromObject(response.optJSONObject(DATA_KEY), getClassT());
	}
	
}
